//
//  SWMineTableViewController.m
//  sc-cyan-ios
//
//  Created by lvjian01 on 2017/12/15.
//  Copyright © 2017年 greenbuilding. All rights reserved.
//

#import "SWMineTableViewController.h"
#import "SWManagerCenterTableViewController.h"
#import "SWPayHistoryViewController.h"
#import "SWMessageCenterTableViewController.h"

@interface SWMineTableViewController ()

@property (weak, nonatomic) IBOutlet UIView *headerBgView;


@end

@implementation SWMineTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    self.edgesForExtendedLayout = UIRectEdgeNone;
//    self.headerBgView.layer.contents = (id)PNGIMAGE(@"geren_beijing").CGImage;
//    self.headerBgView.layer.contents = (id)[[UIImage imageNamed:@"geren_beijing"] CGImage];
    
    
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
    self.navigationController.navigationBarHidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    self.navigationController.navigationBarHidden = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 8;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 0.0001;
}

#pragma mark -- tableviewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    switch (indexPath.section) {
        case 0:{
            switch (indexPath.row) {
                case 0:
                case 1:
                case 2:
                    break;
                    
                default:
                    break;
            }
        }
            
            break;
        case 1:{
            switch (indexPath.row) {
                case 0:{
                    SWManagerCenterTableViewController *centerVC = [SWManagerCenterTableViewController dd_instanceFromStoryboard];
                    centerVC.title = @"管理中心";
                    [self.navigationController showViewController:centerVC sender:nil];
                }
                    break;
                case 1:{
                    SWMessageCenterTableViewController *messageVC = [SWMessageCenterTableViewController dd_instanceFromStoryboard];
                    messageVC.title = @"消息中心";
                    [self.navigationController showViewController:messageVC sender:nil];
                }
                    break;
                case 2:{
                    
                }
                    break;
                case 3:{
                    SWPayHistoryViewController *payVC = [SWPayHistoryViewController dd_instanceFromStoryboard];
                    payVC.title = @"消费历史";
                    [self.navigationController showViewController:payVC sender:nil];
                }
                    break;
                case 4:
                    
                    break;
                    
                default:
                    break;
            }
        }
            
            break;
        default:
            break;
    }
}


/*
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
    
    // Configure the cell...
    
    return cell;
}
*/

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
